package thread;

public class ThreadDemo3 {
    public static void main(String[] args) {
        //第一种
        Thread t1 = new Thread(){
            public void run(){
                System.out.println("我从山中来");
            }
        };
        t1.start();
        //第二种
        Runnable r2 = new Runnable(){
            public void run(){
                for (int i = 0; i < 1000; i++){
                    System.out.println("带着兰花草");
                }
            }
        };
        Thread t2 = new Thread(r2);
        t2.start();
        //第三种
        Thread t3 = new Thread(()->{
                for (int i = 0; i < 1000; i++){
                    System.out.println("带着兰花草");
                }
        });
        t3.start();

    }
}
